% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bapvar_dynamics.R
\name{bapvar_dynamics}
\alias{bapvar_dynamics}
\title{bapvar_dynamics}
\usage{
bapvar_dynamics(
  samples,
  data,
  outcomes = c("SCcites", "ACcites", "DCcites"),
  covariates = c("age", "distance", "overruled"),
  p,
  h,
  shock = "sd",
  scale_by_mean = TRUE,
  ordering = NULL,
  verbose = FALSE,
  check_nth = 1000
)
}
\arguments{
\item{samples}{A numeric matrix or mcmc object containing posterior draws}

\item{data}{A dataframe with the endogenous & exogenous variable observations}

\item{outcomes}{A character vector of column names indicating which columns
in \code{data} contain the endogenous variable observations}

\item{covariates}{A character vector of column names indicating which
columns in \code{data} contain the exogenous variable observations}

\item{p}{An integer vector of length one giving the number of lags}

\item{h}{An integer vector of length one giving the number of periods to
compute impulse responses for; note in the first period this is the
initial shock, then impulse responses for h-1 additional steps are computed}

\item{shock}{A character vector of length one giving the type of shock;
should be one of "sd" (the default -- a one standard deviation shock)
or "unit" (a one unit shock)}

\item{scale_by_mean}{A logical vector of length 1; if TRUE (the default),
the shocks are scaled by the equation means}

\item{ordering}{An integer vector of length m giving the order to draw
the equations' DFEV plots; if NULL (the default), the ordering is 1:m}

\item{verbose}{A logical vector of length one; if TRUE, a progress update
is given every \code{check_nth} iteration (default is FALSE)}

\item{check_nth}{An integer vector of length one that determines how many
iterations pass between user interrupt checks (and if verbose, how often
progress updates are given)}
}
\value{
A list of length two, with class "bapvar_dynamics", containing:
\describe{
\item{irf}{
An array of dimensions \code{c(nrow(samples), ncol(y)^2, h)}
giving the IRF at each of the h steps at each of the posterior
draws with class "bapvarIRF".
}
\item{fevd}{
An array of dimensions \code{c(nrow(samples), ncol(y)^2, h)}
giving the FEVD at each of the h steps at each of the posterior
draws with class "bapvarFEVD".
}
}
}
\description{
Compute Impulse Response Function and Forecast Error Variance Decomposition
from Posterior BaP-VAR Draws
}
